layui.use(['layer', 'form', 'admin', 'address', 'HttpRequest'], function () {
    let $ = layui.jquery;
    let HttpRequest = layui.HttpRequest;
    let form = layui.form;
    let admin = layui.admin;
    let address = layui.address;

    new address("area_code",form);

    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        let request = new HttpRequest(Feng.ctxPath + "/kindergarten/add", 'post', function (data) {
            Feng.success("添加成功！");
            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);
            //关掉对话框
            admin.closeThisDialog();

        }, function (data) {
            Feng.error("添加失败！" + data.message)
        });
        request.set(data.field);
        request.start(true);

        //添加 return false 可成功跳转页面
        return false;
    });
});
